﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace CommunitySystemModel
{
    [Serializable]
    [DataContract]
    public class ZhaoLu_LuYongGuanLiModel
    {
        private int _ID;
        [DataMember]
        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }
        private int _ZhaoLu_DaoRuKaoShengID;
        [DataMember]
        public int ZhaoLu_DaoRuKaoShengID
        {
            get { return _ZhaoLu_DaoRuKaoShengID; }
            set { _ZhaoLu_DaoRuKaoShengID = value; }
        }

        private string _LuYongLeiXing = string.Empty;
        [DataMember]
        public string LuYongLeiXing
        {
            get { return _LuYongLeiXing; }
            set { _LuYongLeiXing = value; }
        }

        private DateTime? _LuYongRiQi ;
        [DataMember]
        public DateTime? LuYongRiQi
        {
            get { return _LuYongRiQi; }
            set { _LuYongRiQi = value; }
        }
        public static ZhaoLu_LuYongGuanLiModel FillEntity(DataRow dr)
        {
            ZhaoLu_LuYongGuanLiModel right = new ZhaoLu_LuYongGuanLiModel();
            if (dr.Table != null && dr.Table.Columns.Contains("ZhaoLu_DaoRuKaoShengID")) right.ZhaoLu_DaoRuKaoShengID = Convert.ToInt32(dr["ZhaoLu_DaoRuKaoShengID"]);
            if (!string.IsNullOrEmpty(dr["ID"].ToString())) right.ID = Convert.ToInt32(dr["ID"]);
            right.LuYongLeiXing = dr["LuYongLeiXing"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("LuYongRiQi"))
            {
                if (Convert.ToDateTime(dr["LuYongRiQi"]) != Convert.ToDateTime("1900-01-01")) right.LuYongRiQi = Convert.ToDateTime(dr["LuYongRiQi"]);
            }
            return right;
        }
    }
}
